<template>
    <div>
        <div class="task_list mainToBottom index_width text_center">
            <img src="../../static/img/title2.png">
            <div class="company_order_sure">
                <h3 class="text_center">
                    {{submitResult.companyName}}</h3>
                <ul class="company_order_sure_ul">
                    <li class="f_left" style="margin-right: 100px;margin-left: 30px">总报名人数：<span class="company_zong_num">
                            {{submitResult.loseApply.length+submitResult.succeeApply.length}}人</span></li>
                    <li class="f_left" style="margin-right: 80px;">报名失败人数：<span>
                            {{submitResult.loseApply.length}}人</span></li>
                    <li class="f_left">总费用：<span class="company_zong_fei">
                            {{submitResult.price}}元</span></li>
                </ul>
                <div class="company_table_success">
                    <table width="100%">
                        <thead>
                            <tr>
                                <td width="80px">姓名</td>
                                <td width="190px">身份证号</td>
                                <td>项目类别</td>
                                <td>专业（工种）</td>
                                <td>价格</td>
                                <td v-if="typeWang=='jxtzg'">是否参加体检预约</td>
                                <td width="200px">备注</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="(item,index) in submitResult.succeeApply" :key="index">
                                <td width="80px">{{item.realName}}</td>
                                <td width="190px">{{item.identity}}</td>
                                <td>{{productName}}</td>
                                <td class="preWhite">{{item.typeName}}</td>
                                <td>{{item.price}}元</td>
                                <td v-if="typeWang=='jxtzg'">
                                    {{isTiPrev==1?'是':'否'}}
                                </td>
                                <td width="200px">{{item.remark}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <p style="margin: 50px 0 30px 30px;font-weight: bolder;font-size: 20px;">报名失败统计</p>
                <div class="company_table_success table_error">
                    <table width="100%">
                        <thead>
                            <tr>
                                <td>姓名</td>
                                <td>身份证号</td>
                                <td>项目类别</td>
                                <td>专业（工种）</td>
                                <td>失败原因</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="(item,index) in submitResult.loseApply" :key="index">
                                <td>{{item.realName}}</td>
                                <td>{{item.identity}}</td>
                                <td>{{productName}}</td>
                                <td class="preWhite">{{item.typeName}}</td>
                                <td>{{item.remark}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="company_order_btns text_center">
            <a class="company_order_next_btn" @click="goLast">上一步</a>
            <a class="company_order_next_btn" @click="merchantApplyToSubmit">去付款</a>
        </div>
    </div>
</template>

<script>
    export default {
        props: ["submitResult", "productName", "typeWang"],
        data() {
            return {
                isTiPrev: 0
            }
        },
        mounted: function() {
            this.isTiPrev = localStorage.getItem("isTiPrev");
        },
        methods: {
            merchantApplyToSubmit: function() {
                var that = this;
                this.common.post(this.api.merchantApplyToSubmit, {}, function(data) {
                    that.common.toPage("/apply/zhifubao/" + data.resultMap);
                });
            },
            goLast: function() {
                this.$emit("goPrev", '');
            }
        }
    }
</script>

<style>
</style>
